// Create a class for the element
class PopUpInfo extends HTMLElement {
    constructor() {
        // Always call super first in constructor
        super();
        // Create a shadow root
        const shadow = this.attachShadow({mode: 'open'});
        // Create spans
        const wrapper = document.createElement('span');
        wrapper.innerHTML = this.innerHTML;
        wrapper.setAttribute('class', 'wrapper');
        // Apply external styles to the shadow dom
        const linkElem = document.createElement('link');
        linkElem.setAttribute('rel', 'stylesheet');
        linkElem.setAttribute('href', 'style.css');
        // Attach the created elements to the shadow dom
        shadow.appendChild(linkElem);
        shadow.appendChild(wrapper);
    }
}
// Define the new element
customElements.define('popup-info', PopUpInfo);